package org.cybot.generator;

import java.util.Random;

public abstract class AbstractGenerator<T> {

	protected Random r = new Random();
	
	private String randomString(Integer count) {
		StringBuffer sb = new StringBuffer();
		char ch;
		for (int i = 0; i < count; i++) {
			ch = (char) (r.nextInt(95) + 32);
			sb.append(ch);
		}
		return sb.toString();
	}
	
	protected String shortString() {
		return randomString(5 + r.nextInt(5));
	}

	protected String longString() {
		return randomString(10 + r.nextInt(10));
	}
	
	public abstract T generateInstance(Object... params);
	
}
